<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS的布局小技巧3</title>
    <style>
        .d1 {
            width: 400px;
            height: 400px;
            background-color: grey;
            text-align: center;
            line-height: 400px;
            font-size: 0;
        }
        img {
            vertical-align: middle;
        }
        span {
            vertical-align: middle;
            font-size: 40px;
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="d1">
        <span>出来玩啊?</span>
        <img src="../images/悟空.jpg">
    </div>
</body>
</html>